'use strict';

const { Controller } = require('egg');
const { Op } = require('sequelize');
const serviceName = 'videoRecord'
class RouterController extends Controller {
    async allList() {
        const { service } = this.ctx;
        const { query } = this.ctx;
        const { deviceId, farmId} = query;
        let where = {}
        if (deviceId) {
            where.device_id = deviceId
        }
        if (farmId) {
            where.farm_id = farmId
        }
        const list = await service[serviceName].allList(where);
        this.ctx.success(list);
    }
}

module.exports = RouterController;
